---
title: "Canvassing_meta_analysis"
author: "Jose S. Gomez"
date: "4/8/2019"
output: html_document
---


```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

#setup clean working environment, packages and data
```{r}
rm(list=ls())       # clear objects in memory
setwd("/Users/jge/Dropbox/GOTV IV (Andrew, Jose, Don)/Working Data/") # set working directory
library(foreign) 
library(metafor) # meta-analysis package
gotv_canvass <- read.csv("GOTV IV Canvass Data (collapsed).csv")
```

#table A-2, Table A-2 replication, Meta-Analysis Results, by Base Rate of Turnout
```{r}
#first all canvassing results
rma(yi = Meta_b[Control_turnout < 30], 
    sei= Meta_SE[Control_turnout < 30],
    method = "DL", 
    data= gotv_canvass)

rma(yi = Meta_b[Control_turnout >= 30 & Control_turnout <= 50], 
    sei= Meta_SE[Control_turnout >= 30 & Control_turnout <= 50],
    method = "DL", 
    data= gotv_canvass)

rma(yi = Meta_b[Control_turnout >= 50 & Control_turnout <= 70], 
    sei= Meta_SE[Control_turnout >= 50 & Control_turnout <= 70],
    method = "DL", 
    data= gotv_canvass)

rma(yi = Meta_b[Control_turnout >= 70], 
    sei= Meta_SE[Control_turnout >= 70],
    method = "DL", 
    data= gotv_canvass)
#nonadvocacy only
rma(yi = Meta_b[Control_turnout < 30 & Advocacy == 0], 
    sei= Meta_SE[Control_turnout < 30 & Advocacy == 0],
    method = "DL", 
    data= gotv_canvass)

rma(yi = Meta_b[Control_turnout >= 30 & Control_turnout <= 50 & Advocacy == 0], 
    sei= Meta_SE[Control_turnout >= 30 & Control_turnout <= 50 & Advocacy == 0],
    method = "DL", 
    data= gotv_canvass)

rma(yi = Meta_b[Control_turnout >= 50 & Control_turnout <= 70 & Advocacy == 0], 
    sei= Meta_SE[Control_turnout >= 50 & Control_turnout <= 70 & Advocacy == 0],
    method = "DL", 
    data= gotv_canvass)

rma(yi = Meta_b[Control_turnout >= 70 & Advocacy == 0], 
    sei= Meta_SE[Control_turnout >= 70 & Advocacy == 0],
    method = "DL", 
    data= gotv_canvass)
```
